package com.gateway.security.common.authentication.client;

import reactor.core.publisher.Mono;

import java.util.Map;

/**
 * @program: api-gateway
 * @description:
 * @author: YuKai Fan
 * @create: 2025/2/11 21:13
 **/
public class DefaultClientPrincipalConverter implements ClientPrincipalConverter {

    private final static DefaultClientPrincipalConverter INSTANCE = new DefaultClientPrincipalConverter();

    private DefaultClientPrincipalConverter() {}

    public static DefaultClientPrincipalConverter getInstance() {
        return INSTANCE;
    }

    @Override
    public Mono<ClientPrincipal> convert(Map<String, Object> claims) {
        return Mono.just(new DefaultClientPrincipal(claims));
    }
}
